        class Course {
	    private int id;
	    private String name;
	    private String location;
	    private String time;

	    // 构造方法
	    public Course(int id, String name, String location, String time) {
	        this.id = id;
	        this.name = name;
	        this.location = location;
	        this.time = time;
	    }

	    // Getter方法
	    public int getId() {
	        return id;
	    }

	    public String getName() {
	        return name;
	    }

	    public String getLocation() {
	        return location;
	    }

	    public String getTime() {
	        return time;
	    }
	}

	// Teacher类：表示教师
	class Teacher {
	    private int id;
	    private String name;
	    private String gender;
	    private Course taughtCourse; // 教师授课的课程

	    // 构造方法
	    public Teacher(int id, String name, String gender) {
	        this.id = id;
	        this.name = name;
	        this.gender = gender;
	    }

	    // 教师开课方法
	    public void openCourse(Course course) {
	        this.taughtCourse = course;
	        System.out.println("教师" + name + "开设了课程《" + course.getName() + "》，课程编号：" + course.getId());
	    }

	    // Getter方法
	    public Course getTaughtCourse() {
	        return taughtCourse;
	    }

	    public String getName() {
	        return name;
	    }
	}

	// Student类：表示学生
	class Student {
	    private int id;
	    private String name;
	    private String gender;
	    private Course selectedCourse; // 学生所选课程

	    // 构造方法
	    public Student(int id, String name, String gender) {
	        this.id = id;
	        this.name = name;
	        this.gender = gender;
	    }

	    // 选课方法
	    public void selectCourse(Course course) {
	        this.selectedCourse = course;
	        System.out.println("学生" + name + "选择了课程《" + course.getName() + "》");
	    }

	    // 退课方法
	    public void dropCourse() {
	        if (selectedCourse != null) {
	            System.out.println("学生" + name + "退选了课程《" + selectedCourse.getName() + "》");
	            selectedCourse = null;
	        } else {
	            System.out.println("学生" + name + "当前未选任何课程，无法退课");
	        }
	    }

	    // 打印个人课表方法
	    public void printCourseTable() {
	        if (selectedCourse != null) {
	            System.out.println("学生" + name + "的课表：");
	            System.out.println("课程编号：" + selectedCourse.getId() + "，课程名称：" + selectedCourse.getName());
	            System.out.println("上课地点：" + selectedCourse.getLocation() + "，上课时间：" + selectedCourse.getTime());
	        } else {
	            System.out.println("学生" + name + "当前未选任何课程");
	        }
	    }
	}

	// 测试主类
	public class StudentCourseSystemTest {
	    public static void main(String[] args) {
	        // 创建课程对象
	        Course c1 = new Course(1001, "Java程序设计", "实验楼302", "周一上午1-2节");

	        // 创建教师对象并开课
	        Teacher t1 = new Teacher(2001, "张老师", "男");
	        t1.openCourse(c1);

	        // 创建学生对象并选课、退课、打印课表
	        Student s1 = new Student(3001, "李四", "女");
	        s1.selectCourse(c1);
	        s1.dropCourse();
	        s1.printCourseTable();

	        Student s2 = new Student(3002, "王五", "男");
	        s2.selectCourse(c1);
	        s2.printCourseTable();
	    }
	}